* (bug 4838) Add relative oldids (prev, next, cur) for raw pages
authorRob Church <robchurch@users.mediawiki.org>
Sun, 26 Feb 2006 16:10:58 +0000 (16:10 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Sun, 26 Feb 2006 16:10:58 +0000 (16:10 +0000)
  Patch by Lupin

RELEASE-NOTES
includes/RawPage.php

index 7cca090..5e6719d 100644 (file)
@@ -660,7 +660,8 @@ fully support the editing toolbar, but was found to be too confusing.
   updated language code assignments
 * (bug 5081) Remove bogus fix for invalid characters in links which simply
   broke use of legitimate multiple whitespace characters in bracketed link.
-
+* (bug 4838) Add relative oldids (prev, next, cur) for raw pages
+  Patch by Lupin
 
 === Caveats ===
 
index ee28f47..b622fec 100644 (file)
@@ -40,7 +40,21 @@ class RawPage {
                $smaxage = $this->mRequest->getIntOrNull( 'smaxage', $wgSquidMaxage );
                $maxage = $this->mRequest->getInt( 'maxage', $wgSquidMaxage );
                $this->mExpandTemplates = $this->mRequest->getVal( 'templates' ) === 'expand';
-               $this->mOldId = $this->mRequest->getInt( 'oldid' );
+               
+               $oldid = $this->mRequest->getInt( 'oldid' );
+               switch ( $wgRequest->getText( 'direction' ) ) {
+                       case 'next': 
+                               $oldid = $this->mTitle->getNextRevisionId( $oldid );
+                               break;
+                       case 'prev': 
+                               $oldid = $this->mTitle->getPreviousRevisionId( $oldid );
+                               break;
+                       case 'cur':
+                               $oldid = 0;
+                               break;
+               }
+               $this->mOldId = $oldid;
+               
                # special case for 'generated' raw things: user css/js
                $gen = $this->mRequest->getVal( 'gen' );